Skip to content

Fix opcache phar check - #25128

Closed
ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:fix-flaky-phar
Closed

ndossche wants to merge 1 commit into
php:PHP-8.4from
ndossche:fix-flaky-phar

Conversation

@ndossche

@ndossche ndossche commented Nov 1, 2026

Copy link
Copy Markdown
Member

This is the cause of the flaky nightly failures on PPC for issue0149.phpt. On slow machines, enough time passes that request 2/3 are served from opcache rather than from the disk.
If we set opcache.file_update_protection=0, then the failure reproduces predictably.
The root cause is that the phar check in opcache only checks if the filename ends in .phar whereas ext/phar checks whether .phar is anywhere in the filename. This difference causes requests from the cache to not execute the stub, and therefore not execute the Phar::mount() call in the test, and therefore fail the expectation.

This is the cause of the flaky nightly failures on PPC for `issue0149.phpt`.
On slow machines, enough time passes that request 2/3 are served from
opcache rather than from the disk.
If we set `opcache.file_update_protection=0`, then the failure
reproduces predictably.
The root cause is that the phar check in opcache only checks if the
filename ends in `.phar` whereas ext/phar checks whether `.phar` is
anywhere in the filename. This difference causes requests from the cache
to not execute the stub, and therefore not execute the `Phar::mount()`
call in the test, and therefore fail the expectation.

@LamentXU123 LamentXU123 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants